package com.ocom.srvpamh.feignclient;

import com.ocom.common.constant.SrvpAccessDeviceUrl;
import com.ocom.common.resp.RespMachMessage;
import com.ocom.common.vo.VerifyAccessVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "srvpaccess")
public interface SrvpAccessFeignService {

    @GetMapping(SrvpAccessDeviceUrl.URLP_ACCESSDEVICE_getDeviceFlag)
    public RespMachMessage getDeviceFlag(@RequestParam("companyId")Long companyId,@RequestParam("machNo") String machNo,@RequestParam("versionCode") String versionCode);

    @GetMapping(SrvpAccessDeviceUrl.URLP_ACCESSDEVICE_getMachPara)
    public RespMachMessage getMachPara(@RequestParam("companyId")Long companyId,@RequestParam("machNo") String machNo);

    //更改设备参数状态
    @PostMapping(SrvpAccessDeviceUrl.URLP_ACCESSDEVICE_changeMachParaState)
    public RespMachMessage changeMachParaState(@RequestParam("companyId")Long companyId,@RequestParam("machNo") String machNo,@RequestParam("jobId")String jobId);

    // 验证门禁权限（verifyAccess）
    @PostMapping(value = SrvpAccessDeviceUrl.URLP_ACCESSDEVICE_verifyAccess)
    RespMachMessage verifyAccess(VerifyAccessVo verifyAccessVo);

    @GetMapping(value = SrvpAccessDeviceUrl.URLP_ACCESSDEVICE_getWhiteList)
    public RespMachMessage getWhiteList(@RequestParam("companyId")Long companyId,@RequestParam("machNo") String machNo,
                               @RequestParam("listLimit")Integer listLimit);

    @PostMapping(value = SrvpAccessDeviceUrl.URLP_ACCESSDEVICE_changeWhiteListState)
    public RespMachMessage changeWhiteListState(@RequestParam("companyId")Long companyId, @RequestParam("machNo")String machNo);


    // 获取权限组参数（getGroupPara）
    @GetMapping(value = SrvpAccessDeviceUrl.URLP_ACCESSDEVICE_getGroupPara)
    public RespMachMessage getGroupPara(@RequestParam("companyId")Long companyId,@RequestParam("machNo") String machNo,@RequestParam("perGroupNum") Long perGroupNum);

    // 获取权限组参数（getGroupParaNew）
    @GetMapping(value = SrvpAccessDeviceUrl.URLP_ACCESSDEVICE_getGroupParaNew)
    public RespMachMessage getGroupParaNew(@RequestParam("companyId")Long companyId,@RequestParam("machNo") String machNo,@RequestParam("perGroupNum") Long perGroupNum);

    // 获取门禁时区表（getZoneTime）
    @GetMapping(value = SrvpAccessDeviceUrl.URLP_ACCESSDEVICE_getZoneTime)
    public RespMachMessage getZoneTime(@RequestParam("companyId")Long companyId,@RequestParam("machNo") String machNo);

    // 更改时区表状态（changeZoneTimeState）
    @PostMapping(value = SrvpAccessDeviceUrl.URLP_ACCESSDEVICE_changeZoneTimeState)
    public RespMachMessage changeZoneTimeState(@RequestParam("companyId")Long companyId,@RequestParam("machNo") String machNo);


    // 获取解码密钥（getDecodeKey）
    @GetMapping(value = SrvpAccessDeviceUrl.URLP_ACCESSDEVICE_getDecodeKey)
    public RespMachMessage getDecodeKey(@RequestParam("companyId")Long companyId,@RequestParam("machNo") String machNo
            ,@RequestParam("deviceType") Integer deviceType);


    // 更改密钥状态（changeKeyState）
    @PostMapping(value = SrvpAccessDeviceUrl.URLP_ACCESSDEVICE_changeKeyState)
    public RespMachMessage changeKeyState(@RequestParam("companyId")Long companyId,@RequestParam("machNo") String machNo,@RequestParam("jobId")String jobId);
}
